package com.tech.connect.api;


import com.ksy.common.utils.CommonApiUtils;
import com.tech.connect.model.ItemLvXin;
import com.tech.connect.model.ItemLvXinYao;
import com.tech.connect.model.PagerModel;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;


/**
 * Created by Ksy
 */

public class LvXinHttp extends CommonApiUtils {
    public static Map<String, Object> getMap() {
        return new HashMap<>();
    }

    public interface ConnectApiServer {

        @POST("v1/service/travel/page")
        Observable<BaseEntity<PagerModel<ItemLvXin>>> lvxingPei(@Body Map<String, Object> map);

        @POST("v1/service/travel/invite/page")
        Observable<BaseEntity<PagerModel<ItemLvXinYao>>> lvxingYao(@Body Map<String, Object> map);

        @POST("v1/service/travel/invite/create")
        Observable<BaseEntity<String>> createYao(@Body Map<String, Object> map);

        @POST("v1/service/travel/create")
        Observable<BaseEntity<String>> createPei(@Body Map<String, Object> map);

        @POST("v1/service/travel/order/create")
        Observable<BaseEntity<Object>> createOrder(@Body Map<String, Object> map);


    }

    public static Observable<BaseEntity<Object>> createOrder(Map<String, Object> map, final BaseEntityOb<Object> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).createOrder(map));
    }
    public static Observable<BaseEntity<String>> createPei(Map<String, Object> map, final BaseEntityOb<String> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).createPei(map));
    }

    public static Observable<BaseEntity<String>> createYao(Map<String, Object> map, final BaseEntityOb<String> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).createYao(map));
    }
    public static Observable<BaseEntity<PagerModel<ItemLvXinYao>>> lvxingYao(Map<String, Object> map, final BaseEntityOb<PagerModel<ItemLvXinYao>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).lvxingYao(map));
    }

    public static Observable<BaseEntity<PagerModel<ItemLvXin>>> lvxingPei(Map<String, Object> map, final BaseEntityOb<PagerModel<ItemLvXin>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).lvxingPei(map));
    }


}
